using UnityEngine;

public class Capture : MonoBehaviour
{
    public Transform target;
    public Vector2 localPosition;
    public Vector2 range_min = new(-1.5f,-1.5f);
    public Vector2 range_max = new(1.5f,1.5f);

    public void UpdateTargetPosition(Vector2 localPosition)
    {
        if (target != null)
        {
            this.localPosition.x = Mathf.Clamp(localPosition.x, range_min.x, range_max.x);
            this.localPosition.y = Mathf.Clamp(localPosition.y, range_min.y, range_max.y);
            target.localPosition = this.localPosition;        
        }
    }
}
